import NetWork from '@Config/server/api/base'

/***
 * @description 分页查询文件夹-回收站
 *
 */
export const libFileList = async (_data) => {
  if (typeof _data?.tagIdList == 'string') {
    _data.tagIdList = [_data.tagIdList]
  }
  let work = await NetWork('/lib/fileList', {
    body: JSON.stringify(_data),
  })

  work.data?.records?.map((x) => {
    x.local_loading = false
    return x
  })
  return work
}

//创建文件夹
export const libNewFolder = async (_data) => {
  let work = await NetWork('/lib/newFolder', {
    body: JSON.stringify(_data),
  })

  return work
}

///lib/del

//删除恢复文件-文件夹
export const libDel = async (_data) => {
  let work = await NetWork('/lib/del', {
    body: JSON.stringify(_data),
  })
  return work
}

///修改文件-文件夹名称

export const libRename = async (_data) => {
  let work = await NetWork('/lib/rename', {
    body: JSON.stringify(_data),
  })
  return work
}

//移动文件-文件夹
export const libMove = async (_data) => {
  let work = await NetWork('/lib/move', {
    body: JSON.stringify(_data),
  })
  return work
}

///批量下载图片zip
export const libDownLoadBatch = async (_data) => {
  let work = await NetWork('/lib/downloadBatch', {
    body: JSON.stringify(_data),
  })
  return work
}

//单个文件详情
export const libFileDetail = async (_data) => {
  let work = await NetWork('/lib/fileDetail', {
    body: JSON.stringify(_data),
  })
  return work
}
//图片设置标签
export const libPicSetTag = async (_data) => {
  let work = await NetWork('/lib/picSetTag', {
    body: JSON.stringify(_data),
  })
  return work
}

///lib/picBatchAddTag

export const libPicBatchAddTag = async (_data) => {
  let work = await NetWork('/lib/picBatchAddTag', {
    body: JSON.stringify(_data),
  })
  return work
}

//图片添加、修改评价，新增id=0
export const libAddComment = async (_data) => {
  let work = await NetWork('/lib/addComment', {
    body: JSON.stringify(_data),
  })
  return work
}
